#include "HeliCtrlFrame.h"
#include "HeliCtrlPanel.h"
#include "HeliCtrlAbout.h"
#include "fileversion.h"

BEGIN_EVENT_TABLE( HeliCtrlFrame, MainFrame )
	EVT_MENU( ID_FILE_EXIT, HeliCtrlFrame::OnExit )
	EVT_MENU( ID_HELP_ABOUT, HeliCtrlFrame::OnAbout )
END_EVENT_TABLE()

HeliCtrlFrame::HeliCtrlFrame( wxWindow *parent, int id )
	: MainFrame( parent, id )
{
	wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
	wxPanel* panel = new HeliCtrlPanel( this );
	sizer->Add( panel, 1, wxEXPAND );
	wxSize panelSize = panel->GetSize();
	this->SetSizerAndFit( sizer );
	this->SetClientSize( panelSize );	


	wxFileVersion ver;
	ver.Open();
	wxString fileVersion = ver.GetFixedFileVersion( true );
	int w[] = {-1,100};
	GetStatusBar()->SetStatusWidths(2,w);
	GetStatusBar()->SetStatusText(_T("Version: ") + fileVersion,1);
}

void HeliCtrlFrame::OnExit( wxCommandEvent& event )
{
	Close();
}

void HeliCtrlFrame::OnAbout( wxCommandEvent& event )
{
	HeliCtrlAbout* about = new HeliCtrlAbout( this );
	about->Show();
}

HeliCtrlFrame::~HeliCtrlFrame()
{
}